package com.pignest.hotel.definition;

public enum BookingStatus {

	ONGOING("预订中")
	, OVERTIME("超时")
	, CANCELED("取消")
	, DONE("入住")
//	,LEAVE("离开")
	;
	
	private String displayName;
	
	private BookingStatus(String cname) {
		this.displayName = cname;
	}
	
	public String getDisplayName() {
		return displayName;
	}
	
	public static BookingStatus fromName(String name) {
		try {
			return BookingStatus.valueOf(name);
		}catch (Exception e) {
		}
		return null;
	}
	
	public static String displayName(String value) {
		BookingStatus status = fromName(value);
		return status == null ? null : status.displayName;
	}
	
	public boolean is(String name) {
		return name().equals(name);
	}
}
